<template>

  <el-upload
    :action="'https://ai.itnewers.com/uoloadEngineAiFile/fileManager/upLoadFile'"
    :on-remove="handleRemoveIcon"
    :before-remove="beforeRemove"
    multiple
    :limit="1"
    :on-exceed="handleExceed"
    :file-list="fileList"
    :on-success="handleSuccessIcon">
    <el-button size="small" type="primary">点击上传</el-button>
  </el-upload>

</template>

<script>
   export default{
     data(){
       return{
         uploadHostStr:'',
         fileList:[]
       }
     },
     methods:{
       handleRemoveIcon(){
           // 移除图片
       },
       handleSuccessIcon(response, file, fileList){
         // this.form.icon1=response.data;
         this.$emit('uploadFileSuccess','https://ai.itnewers.com/files/config/'+response.data)
       },
       handleExceed(files, fileList) {
        this.$message.warning(`当前限制选择 1 个文件，本次选择了 ${files.length} 个文件，共选择了 ${files.length + fileList.length} 个文件`);
      },
      beforeRemove(file, fileList) {
        return this.$confirm(`确定移除 ${ file.name }？`);
      },

     }
   }
</script>

<style>
</style>
